﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="LocationAdvertisement.aspx.cs" Inherits="NEWS.Admin.LocationAdvertisement" %>

<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" ID="Content11" runat="server">

<script type="text/javascript">

function confirmAction() {
    if(confirm('Bạn có chắc chắn muốn xóa???')) {
        // you clicked the OK button.
        // you can allow the form to post the data.
        return true;
    }
    else {             
        // you clicked the Cancel button.
        // you can disallow the form submission.
        return false;
    }
}

    function alertAction() {
    alert('Bạn phải xóa những tin thuộc khu vực này trước !!!') ;
  
}


    </script>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server">
                <div class="dashboard">
                    <h2 class="ico_mug">
                        Danh Sách Vị Trí Quảng Cáo
                    </h2>
                    <div>
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            DataKeyNames="LocationAdversitementID" DataSourceID="ObjectDataSource1" ForeColor="#333333" GridLines="None"
                            Width="100%" AllowPaging="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:CommandField ButtonType="Image" SelectImageUrl="~/Admin/img/edit.png" ShowSelectButton="True" />
                                <asp:BoundField DataField="LocationAdversitementID" HeaderText="Mã vị trí" InsertVisible="False"
                                    ReadOnly="True" SortExpression="LocationAdversitementID">
                                    <HeaderStyle HorizontalAlign="Center" Width="170px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="LocationAdversitementName" HeaderText="Tên vị trí" 
                                    SortExpression="LocationAdversitementName">
                                    <HeaderStyle HorizontalAlign="Left" Width="270px" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Kích hoạt">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cbIsActive" runat="server" Checked='<%# Eval("IsActive") %>' 
                                            Enabled="False" />
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Left" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetLocationAdvertisementBOList"
                            TypeName="HousingInfo.Library.LocationAdvertisementBOList"></asp:ObjectDataSource>
                        <br />
                        <asp:Label ID="messagedelete" runat="server" Font-Bold="True" 
                            Font-Size="Medium" ForeColor="#FF3300"></asp:Label>
                    </div>
                </div>
            </asp:Panel>
            <asp:Panel Width="100%" ID="pn_danhsach_qc_chitiet" runat="server" Visible="false">
                <div class="dashboard">
                    <h2 class="ico_mug">
                        &nbsp;<asp:Label ID="lbAreaDetail" runat="server" Text="Chỉnh sửa vị trí"></asp:Label>
                    </h2>
                    
                    <div>
                        <table width="100%">
                            <tr>
                                <td style="width: 109px">                                
                                </td>
                                <td style="width: 23px">                                
                                </td>
                                <td style="width: 290px">
                                    <asp:Label ID="lbmessage" runat="server" Text="[Thong Bao]" ForeColor="Red" Font-Bold="True" Font-Size="15px"></asp:Label>
                                </td>
                                <td></td>
                            </tr>
                            <tr>
                                <td style="width: 109px; text-align:right;">
                                    <asp:Label ID="lbmvt" Width="100%" runat="server" Text="Mã vị trí"></asp:Label>
                                </td>
                                <td style="width: 23px">
                                </td>
                                <td style="width: 290px">
                                    <asp:TextBox Width="90%" ID="txtvitriid" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:Button ID="btncapnhat" runat="server" Text="Cập Nhật" Width="114px" 
                                        onclick="btncapnhat_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 109px; text-align:right;">
                                    <asp:Label ID="lbtvt" Width="100%" runat="server" Text="Tên vị trí"></asp:Label>
                                </td>
                                <td style="width: 23px">
                                </td>
                                <td style="width: 290px">
                                    <asp:TextBox Width="90%" ID="txttenvitri" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:Button ID="btnhuy" runat="server" Text="Hủy" Width="114px" 
                                        onclick="btnhuy_Click" />
                                </td>
                            </tr>
                             <tr>
                                <td style="width: 109px; text-align:right;">
                                    <asp:Label ID="Label1" Width="100%" runat="server" Text="Kích Hoạt"></asp:Label>
                                </td>
                                <td style="width: 23px">
                                </td>
                                <td style="width: 290px">
                                    <asp:CheckBox ID="cbkichhoat" runat="server" />
                                </td>                            
                            </tr>
                        </table>
                        <h2 class="ico_mug">
                            &nbsp;<asp:Label ID="Label2" runat="server" Text="Các vị trí quảng cáo chi tiết"></asp:Label>
                        </h2>                        
                    </div>
                    <div>    
                        <asp:LinkButton ID="LinkButton1" runat="server" Font-Bold="True" 
                            ForeColor="Blue" onclick="LinkButton1_Click">Thêm mới vị trí quảng cáo</asp:LinkButton>                   
                        <br />                            
                        <asp:GridView ID="GridView2" Width="100%" runat="server" AllowPaging="True" 
                            CellPadding="4" ForeColor="#333333" GridLines="None" 
                            onselectedindexchanged="GridView2_SelectedIndexChanged" 
                            AutoGenerateColumns="False" onrowcommand="GridView2_RowCommand">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:CommandField ShowSelectButton="True" ButtonType="Image" 
                                    SelectImageUrl="~/Admin/img/edit.png" >
                                    <ItemStyle Width="20px" />
                                </asp:CommandField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Delete" 
                                            ImageUrl="~/Admin/img/cancel.png" 
                                            onclientclick="javascript:return confirmAction();" />
                                    </ItemTemplate>
                                    <ItemStyle Width="20px" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="LocationAdversitementDetailID" 
                                    HeaderText="Mã vị trí chi tiết" >
                                    <ItemStyle HorizontalAlign="Center" Width="100px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Tin đăng ký quảng cáo">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LbtTitle" runat="server" Text='<% # Eval("Title") %>'></asp:LinkButton>
                                        <asp:HiddenField ID="NewsId" runat="server" 
                                            Value='<%# Eval("NewsHouseID") %>' />
                                        <asp:HiddenField ID="Gia" runat="server" Value='<%# Eval("Price") %>' />
                                        <asp:HiddenField ID="MoTa" runat="server" Value='<%# Eval("Direction") %>' />
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="LocationInWeb" HeaderText="Vị trí hiển thị" >
                                    <ItemStyle HorizontalAlign="Center" Width="90px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Kích Hoạt">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("IsActive") %>' 
                                            Enabled="False" />
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="70px" />
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>
                </div>                
            </asp:Panel>
            
            <asp:Panel ID="Pn_location_detail" runat="server" Visible="false">
                <div class="dashboard">
                    <h2 class="ico_mug">
                        &nbsp;<asp:Label ID="lbchitietvitrichitiet" runat="server" Text="Vị trí quảng cáo chi tiết"></asp:Label>
                    </h2>
                    <div>
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 133px">                                    
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Label ID="messagedetail" runat="server" Font-Bold="True" Font-Size="Medium"
                                        ForeColor="#FF3300"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 133px; text-align: right;">
                                    <asp:Label ID="lbvitrichitietID" runat="server" Text="Mã vị trí chi tiết :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:TextBox ID="txtvitrichitiet" runat="server" Enabled="False" Width="122px"></asp:TextBox>
                                </td>
                            </tr>                                                                                   
                            <tr>
                                <td style="width: 133px; text-align: right;">
                                    <asp:Label ID="Label6" runat="server" Text="Tin đăng ký quảng cáo :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:TextBox ID="txttindangkyquangcao" runat="server" Enabled="False" 
                                        Width="439px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 120px; text-align: right;">
                                    <asp:Label ID="Label7" runat="server" Text="Vị trí hiển thị :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:DropDownList ID="dlvitrihienthi" runat="server" Height="20px" 
                                        Width="125px" style="margin-left: 4px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 133px; text-align: right;">
                                <asp:Label ID="Label4" runat="server" Text="Kích hoạt :"></asp:Label>
                                </td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:CheckBox ID="isActivevitrichitiet" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 133px; text-align: right;">
                                    &nbsp;</td>
                                <td style="width: 20px">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Button ID="btnUpdatevitrichitietDetail" runat="server" Text="Cập nhật" 
                                        ValidationGroup="2" onclick="btnUpdatevitrichitietDetail_Click" />
                                    &nbsp;
                                    <asp:Button ID="btnAddvitrichitietDetail" runat="server" Text="Thêm" 
                                        ValidationGroup="2" onclick="btnAddvitrichitietDetail_Click" />
                                    <asp:Button ID="btndong" runat="server" Text="Đóng" onclick="btndong_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
